/* 侧边栏公共样式 - 用于首页和文章详情页 */

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.sidebar {
    flex: 1;
}

/* 侧边栏样式 */
.sidebar-widget {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.dark-mode .sidebar-widget {
    background-color: var(--light);
}

.sidebar-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.widget-title {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
    color: var(--primary);
}

/* 分类样式 */
.categories ul {
    list-style: none;
}

.categories li {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    transition: var(--transition);
}

.categories li:hover {
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: 5px;
    padding-left: 10px;
}

.categories li:last-child {
    border-bottom: none;
}

.categories a {
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
    font-weight: 500;
}

.dark-mode .categories a {
    color: var(--dark);
}

.categories a:hover {
    color: var(--primary);
}

.categories span {
    background-color: var(--light-gray);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* 热门文章样式 */
.popular-posts .post {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.popular-posts .post:hover {
    transform: translateX(5px);
    cursor: pointer;
}

.popular-posts .post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.post-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.post-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.post-content .date {
    color: var(--gray);
    font-size: 0.85rem;
}

/* 标签云样式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--light-gray);
    color: var(--gray);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.tag-cloud .tag {
    background-color: var(--light-gray);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag-cloud .tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.dark-mode .tag {
    background-color: #333;
}

.tag:hover {
    background-color: var(--primary);
    color: white;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .sidebar {
        grid-template-columns: 1fr;
    }
}